home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / TURBOPASCAL WIN / DOCDEMOS.PAK / MATHDLL.PAS < prev    next >
Pascal/Delphi Source File  |  1992-06-08  |  1KB  |  43 lines

  1. {************************************************}
  2. {                                                }
  3. {   Turbo Pascal for Windows                     }
  4. {   Demo Dynamic Link Library                    }
  5. {   Copyright (c) 1991 by Borland International  }
  6. {                                                }
  7. {************************************************}
  8.  
  9. library MathDll;
  10.  
  11. uses WinTypes, WinProcs;
  12.  
  13. function Power(X, Y: Real): Real; export;
  14. begin
  15.   Power:=Exp(Y * ln(X));
  16. end;
  17.  
  18. function Payments(Period, Interest, Term, Principal: Real): Real; export;
  19. begin
  20.   Payments := (Principal * Interest / Period) /
  21.     (1 - Power(1 + Interest / Period, -Term * Period));
  22. end;
  23.  
  24. function Principals(Payment, Period, Interest, Term: Real): Real; export;
  25. begin
  26.   Principals := Payment * ((1 - Power(1 + Interest / Period,
  27.     -Term * Period)) / (Interest / Period));
  28. end;
  29.  
  30. procedure WriteError(Window: hWnd; ErrorMessage: PChar); export;
  31. begin
  32.   MessageBox(Window, ErrorMessage, 'Error', MB_OK);
  33. end;
  34.  
  35. exports
  36.   Power        index 1,
  37.   Payments     index 2,
  38.   Principals   index 3,
  39.   WriteError   index 4;
  40.  
  41. begin
  42. end.
  43.